<%@ page contentType="text/html" pageEncoding="utf-8" %>
<%@ taglib prefix="e" uri="/eportal" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/style.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/html5.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/respond.min.js"></script>
    <![endif]-->
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
</head>
<style>
	.lt{
		float:left;
	}
	.group{
		*height:20px;
		*margin:20px 0;
	}
	.col-sm-8{
		*width:500px;

	}
	.form-control{
		*height:20px;
	}
</style
<body>
<form class="form-horizontal" style="padding: 10px" id="form"
      action="${pageContext.request.contextPath}/admin/tlocks_sendToBatchTagent.action" method="post">
      <div class="form-group">
	        <div class="form-group group">
				<label class="col-sm-3 control-label lt"><i class="require">*</i>PID初始值:</label>
				<div class="col-sm-8 lt">
					<input class="form-control" name="pidBegin" id="pidBegin" size="30" placeholder="PID编号"/>

				</div>
			</div>
			<div class="form-group group">
				<label class="col-sm-3 control-label lt"><i class="require">*</i>PID结束值:</label>
				<div class="col-sm-8 lt">
					<input class="form-control" name="pidEnd" id="pidEnd" size="30" placeholder="PID编号"/>
				</div>
			</div>
			<div class="form-group group">
				<c:if test="${sessionScope.userRole == 1 || sessionScope.userRole == 2 || sessionScope.userRole == 7}"><%--//todo Updated by Saber on 2017/7/25 下午6:29--%>
					<label class="col-sm-3 col-sm-3 control-label lt"><i class="require"></i>公司名称:</label>
					<div class="col-sm-8 lt">
						<select name="agtCode" id="agtCode"></select>
					</div>
				</c:if>
				<c:if test="${sessionScope.userRole == 3 || sessionScope.userRole == 4}">
					<label class="col-sm-3 lt col-sm-3 control-label"><i class="require"></i>社区名称:</label>
					<div class="col-sm-8 lt">
						<select name="communityId" id="communityId"></select>
					</div>
				</c:if>
			</div>
    </div>
</form>

<script type="text/javascript">
    $(function () {
        $.post("${pageContext.request.contextPath}/admin/tagent_list.action", function (data) {
        	$("#agtCode").empty();
            $("#agtCode").append("<option value=''>请选择公司</option>");
            for (var i = 0; i < data.length; i++) {
                $("#agtCode").append("<option value='" + data[i].agtCode + "'>" + data[i].agtName + "</option>");
            }
            $("#agtCode").select2({
                "placeholder": "请选择公司",
                "width": "100%"
            })
        }, "json");

        $.post("${pageContext.request.contextPath}/admin/tcommunity_list.action", function (data) {
        	$("#communityId").empty();
            $("#communityId").append("<option value=''>请选择社区</option>");
            for (var i = 0; i < data.length; i++) {
                $("#communityId").append("<option value='" + data[i].sid + "'>" + data[i].communityName + "</option>");
            }
            $("#communityId").select2({
                "placeholder": "请选择社区",
                "width": "100%"
            })
        }, "json");

    })
</script>
</body>
</html>
